import { LoggerService } from '@nestjs/common';
import * as log4js from 'log4js';
// 可以代替nestjs日志
export class Log4jsLogger implements LoggerService {
  private logger: log4js.Logger;

  constructor() {
    this.logger = log4js.getLogger();
  }

  log(message: string) {
    this.logger.info(message);
  }

  error(message: string, trace: string) {
    this.logger.error(message, trace);
  }

  warn(message: string) {
    this.logger.warn(message);
  }

  debug(message: string) {
    this.logger.debug(message);
  }

  verbose(message: string) {
    this.logger.trace(message);
  }
}
